from fastapi import APIRouter, HTTPException
from app.models.settings import Settings, SettingsUpdate
from app.services.settings_service import SettingsService

router = APIRouter()

@router.get("/settings", response_model=Settings)
async def get_settings():
    """获取系统设置"""
    service = SettingsService()
    return await service.get_settings()

@router.put("/settings", response_model=Settings)
async def update_settings(settings: SettingsUpdate):
    """更新系统设置"""
    service = SettingsService()
    return await service.update_settings(settings) 